﻿using System;
using Windows.Networking.Sockets;

namespace Coding4Fun.MissionControl.WP.Network
{
    public class SocketConnectorBase
    {
        public event EventHandler<ConnectionEventArgs> OnClientConnected;
        public virtual void OnConnectionCompleted(ConnectionEventArgs connectionArgs)
        {
            if (OnClientConnected != null)
            {
                OnClientConnected(this, connectionArgs);
            }
        }

        public event EventHandler<bool> OnSendCompletedEvent;
        public virtual void OnSendCompleted(bool succeeded)
        {
            if (OnSendCompletedEvent != null)
            {
                OnSendCompletedEvent(this, succeeded);
            }
        }
    }

    public class ConnectionEventArgs : EventArgs
    {
        public StreamSocket Socket { get; set; }
        public string DeviceID { get; set; }
        public string Token { get; set; }
        public bool IsSuccessful { get; set; }
    }
}
